package com.rionosoft.demo.common;

import com.rionosoft.demo.R;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.Button;
import android.widget.RelativeLayout;
import android.widget.TextView;

public class CommonDisplayView extends RelativeLayout {
	
	private TextView mDisplay;
	private Button mBtn;
	
	public CommonDisplayView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	@Override
	protected void onFinishInflate() {
		super.onFinishInflate();
		mDisplay = (TextView) findViewById(R.id.display_txt);
		mBtn = (Button) findViewById(R.id.close_btn);
	}

	public void setDisplayText(String display) {
		mDisplay.setText(display);
	}
	
	public void setDisplayText(int resId) {
		mDisplay.setText(resId);
	}
	
	public void setButtonText(String btnTxt) {
		mBtn.setText(btnTxt);
	}
	
	public void setButtonText(int resId) {
		mBtn.setText(resId);
	}

	public void setOnClickEvent(OnClickListener listener) {
		mBtn.setOnClickListener(listener);
	}

}
